<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	<p:outputPanel id="painelInclusao" rendered="#{bairroBean.modoInclusao or bairroBean.modoEdicao}">
		<p:panel header="#{msg['titulo.bairro.inclusao']}">
			<p:focus for="uf" id="focusPaginaInclusao"/>
			<h:panelGrid columns="2" id="painel2ColunasInclusao">
				<p:outputLabel value="#{msg['label.bairro.uf']}" for="uf" id="labelUf" />
				<p:selectOneMenu value="#{bairroBean.entity.municipio.uf}" id="uf" required="true" requiredMessage="#{msg['bairro.uf.obrigatorio']}" title="#{msg['title.bairro.uf']}" valueChangeListener="#{bairroBean.obterListaMunicipios}" effect="fade" >
					<f:selectItem itemLabel="--Selecione--"/>
					<f:selectItems value="#{utilBean.listaUFs}" />
					<p:ajax event="change" update="municipio" immediate="true"/>
				</p:selectOneMenu>
				<p:outputLabel value="#{msg['label.bairro.municipio']}" for="municipio" id="labelMunicipio" />
				<p:selectOneMenu value="#{bairroBean.entity.municipio}" id="municipio" required="true" requiredMessage="#{msg['bairro.municipio.obrigatorio']}" title="#{msg['title.bairro.municipio']}" converter="municipioConverter" converterMessage="Erro ao converter Municipio" effect="fade">
					<f:selectItem itemLabel="--Selecione--" itemValue=""/>
					<f:selectItems value="#{bairroBean.listaMunicipios}" var="municipio" itemLabel="#{municipio.nome}" itemValue="#{municipio}" />
				</p:selectOneMenu>
				<p:outputLabel value="#{msg['label.bairro.nome']}" for="nome" id="labelNome" />
				<p:inputText value="#{bairroBean.entity.nome}" id="nome" size="60" maxlength="255" required="true" requiredMessage="#{msg['bairro.nome.obrigatorio']}" title="#{msg['title.bairro.nome']}"/>
			</h:panelGrid>
		</p:panel>
	</p:outputPanel>
</ui:composition>